package com.chuangjiangx.member.manager.client.web.coupon.request;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Digits;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

/**
 * @author cj-ch
 * @date 2018/5/28 下午2:35
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class CouponVerifyRequest {
    /**
     * 卡券code
     */
    @NotBlank(message = "卡券code不能是空的")
    private String code;
    /**
     * 订单金额
     */
    @NotNull(message = "金额不能为null")
    @DecimalMin(value = "0.01",message = "金额不能小于0.01")
    @Digits(integer = 6,fraction = 2,message = "金额整数部分不能超过6位小数不能超过2位")
    private BigDecimal amount;
}
